include ../../rules.mk
include ../../opencl.mk


SOURCES := omd_test_md.c 
OBJECTS := $(call to_object,$(SOURCES))
DEPENDS := $(OBJECTS:.o=.d)

all: enter  programs leave
	@echo "====> Finished"

enter:
	@echo "==> building in $(HERE)"

leave:
	@echo "==> all done in $(HERE)"

programs : libs omd_test_md

libs:
	@$(MAKE) -s -C ../../mds
	@$(MAKE) -s -C ../../ocl
	@$(MAKE) -s -C ..

omd_test_md: $(call to_object,omd_test_md.c) ../../.libs/libomd.a ../../.libs/libocl.a ../../.libs/libmds.a
	$(LINK) $(OCL_LDFLAGS)

clean:
	$(CLEAN) 
	@rm -f omd_test_md omd_test_md.exe md.xyz energy.txt

rebuild:
	@$(MAKE) -s -C .. clean && $(MAKE) -s -C ../../mds clean && $(MAKE) -s all
	
gcc-opt:
	@$(MAKE) rebuild MY_CFLAGS="-O2 -DNDEBUG=1 -ftree-vectorize"
	
-include $(DEPENDS)

